import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'
import index from '@/page/index'
import content from '@/page/content'

import user from '@/frame/subroute'

import UserIndex from '@/page/user/index'
import UserInfo from '@/page/user/info'
import UserLove from '@/page/user/love'

Vue.use(Router)

/*const user = {
  template: `
    <div class="user">
      <h2>User</h2>
      <router-view></router-view>
    </div>
  `
}*/

export default new Router({
    mode: 'history',
    routes: [{
        path: '/',
        name: 'index',
        component: index
    }, {
        path: '/content',
        name: 'content',
        component: content
    }, {
        path: '/user',
        component: user,
        children: [
            {path: '/index', /*name: 'UserIndex',*/ component: UserIndex},
            {path: '/info', /*name: 'UserInfo',*/ component: UserInfo},
            {path: '/love', /*name: 'UserLove',*/ component: UserLove}
        ]
    }]
})